<!DOCTYPE html>
<html>
<head>
    <title></title>
    <#include "/header.html" />
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
            <div class="form-group">
                <input type="text" class="form-control col-sm-2" v-model="queryCondition.name" @keyup.enter="query" placeholder="用户名">
                <input type="text" class="form-control col-sm-2" v-model="queryCondition.sfzh" @keyup.enter="query" placeholder="身份证号">
                <select v-model="queryCondition.studytype" class="form-control col-sm-2" @keyup.enter="query">
                    <option value="">学习类型</option>
                    <option v-for="item in offline_type" :value="item.value">{{item.text}}</option>
                </select>
            </div>
            <a class="btn btn-default" @click="query">查询</a>

            <#if shiro.hasPermission("offlinestudy:subscribe:save")>
                <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
            </#if>
            <#if shiro.hasPermission("offlinestudy:subscribe:update")>
                <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
            </#if>
            <#if shiro.hasPermission("offlinestudy:subscribe:delete")>
                <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
            </#if>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default" align="center">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal" style="width:70%!important;">
            <div class="form-group">
                <div class="col-sm-2 control-label" style="width: 20%;">姓名</div>
                <div class="col-sm-10" style="width: 30%;">
                    <input type="text" class="form-control" width="80%" v-model="subscribe.name" placeholder=""/>
                </div>

                <div class="col-sm-2 control-label" style="width: 20%;">身份证号</div>
                <div class="col-sm-10" style="width: 30%;">
                    <input type="text" class="form-control" width="80%" v-model="subscribe.sfzh" placeholder=""/>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label" style="width: 20%;">学习类型</div>
                <div class="col-sm-10" style="width: 30%;">
                    <select class="form-control" v-model="varStudytype" @change="studyOnchange"> <!-- 需要为subscribe.studytype手动赋值 -->
                        <option value="" readonly="">请选择学习类型</option>
                        <option v-for="studytype in offline_type" :value="studytype.value">{{studytype.text}}</option>
                    </select>
                </div>
                <div class="col-sm-2 control-label" style="width: 20%;">手机号</div>
                <div class="col-sm-10" style="width: 30%;">
                    <input type="text" class="form-control" width="80%" v-model="subscribe.tel" placeholder=""/>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label" style="width: 20%;">准驾车型</div>
                <div class="col-sm-10" style="width: 30%;">
                    <select class="form-control" v-model="varJclx">  <!-- 需要为对象subscribe.jclx手动赋值 -->
                        <option value="" readonly="">请选择准驾车型</option>
                        <option :value="jclx_item.value" v-for="jclx_item in jclx">{{jclx_item.text}}</option>
                    </select>
                </div>
                <div class="col-sm-2 control-label" style="width: 20%;">档案编号</div>
                <div class="col-sm-10" style="width: 30%;">
                    <input type="text" class="form-control" width="80%" v-model="subscribe.dabh" placeholder=""/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label" style="width: 20%;">学习时间</div>
                <div class="col-sm-10" style="width: 40%;">
                    <!--<select class="form-control" v-model="varSubscribedateId" @change="dateChange"> &lt;!&ndash; 需要手动为subscribe.subscribedateId赋值 &ndash;&gt;-->
                    <!--<option value=""></option>-->
                    <!--<option v-for="item in subscribedate" :value="item.id" >{{item.subscribedate}}</option>-->
                    <!--</select>-->
                    <!--<span class="input-group-addon" style="color: red;" v-model="message"></span>-->
                    <div class="input-group">
                        <div class="input-group-btn">
                            <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"
                                    @click="checkStudytype">
                                选择<span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu">
                                <template v-for="item in subscribedate">
                                    <li>
                                        <a href="#" @click="subscribedateChecked(item.id)">{{item.subscribedate}}</a>
                                    </li>
                                </template>
                            </ul>
                        </div>
                        <input type="text" class="form-control" v-model="varSubscribedate">
                    </div>
                </div>
            </div>
            <!-- -------------------隐藏---------------------- -->
            <div class="hidden">
                <div class="col-sm-2 control-label" style="width: 10%;"></div>
                <div class="col-sm-10" style="width: 40%;">
                    <input type="text" class="form-control" width="80%" v-model="subscribe.address" placeholder=""/>
                </div>
                <div class="col-sm-2 control-label" style="width: 10%;">预约方式</div>
                <div class="col-sm-10" style="width: 40%;">
                    <input type="text" class="form-control" width="80%" v-model="subscribe.subscribetype"
                           placeholder=""/>
                </div>
            </div>
            <div class="hidden">
                <div class="col-sm-2 control-label" style="width: 10%;"></div>
                <div class="col-sm-10" style="width: 40%;">
                    <input type="text" class="form-control" width="80%" v-model="subscribe.fj" placeholder=""/>
                </div>
                <div class="col-sm-2 control-label" style="width: 10%;"></div>
                <div class="col-sm-10" style="width: 40%;">
                    <input type="text" class="form-control" width="80%" v-model="subscribe.ldate" placeholder=""/>
                </div>
            </div>
            <div class="hidden">
                <div class="col-sm-2 control-label" style="width: 10%;"></div>
                <div class="col-sm-10" style="width: 40%;">
                    <input type="text" class="form-control" width="80%" v-model="subscribe.subscribedateTypeid"
                           placeholder=""/>
                </div>
                <div class="col-sm-2 control-label" style="width: 10%;">学习时间始</div>
                <div class="col-sm-10" style="width: 40%;">
                    <input type="text" class="form-control" width="80%" v-model="subscribe.startdate" placeholder=""/>
                </div>
            </div>
            <div class="hidden">
                <div class="col-sm-2 control-label" style="width: 10%;">学习时间止</div>
                <div class="col-sm-10" style="width: 40%;">
                    <input type="text" class="form-control" width="80%" v-model="subscribe.enddate" placeholder=""/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>
</div>

<script src="${request.contextPath}/statics/js/modules/offlinestudy/subscribe.js?_${.now?long}"></script>
</body>
</html>